package org.vnl.platform.web.impl.myfaces.dojo.component.tag;

import javax.el.ValueExpression;
import javax.faces.webapp.UIComponentELTag;

abstract public class DojoTag extends UIComponentELTag {
    
    private ValueExpression dojoId;
    private ValueExpression dojoProps;

    public ValueExpression getDojoId() {
        return dojoId;
    }

    public void setDojoId(ValueExpression dojoId) {
        this.dojoId = dojoId;
    }

    public ValueExpression getDojoProps() {
        return dojoProps;
    }

    public void setDojoProps(ValueExpression dojoProps) {
        this.dojoProps = dojoProps;
    }
    
    protected String getDojoIdValue() {
        if (dojoId != null) {
            Object obj = dojoId.getValue(getELContext());
            if (obj != null) {
                return obj.toString();
            }
        }
        return null;
    }
    
    protected String getDojoPropsValue() {
        if (dojoProps != null) {
            Object obj = dojoProps.getValue(getELContext());
            if (obj != null) {
                return obj.toString();
            }
        }
        return null;
    }

}
